var fn = function() {
    let arr = readline().split(' ').map(Number);
    let n = arr[0]
    let x = arr[1]
    let c = arr[2]
    let arr1 = readline().split(' ').map(Number);
    var count;
    for (let i = 0; i < n; i++) {
        if (arr1[i] > c && Math.abs(arr1[i] - x) <= 3) {
            count++;
        }
    }
    console.log(count);
}